<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <title>共享阅读</title>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta name="viewport" content="initial-scale=1, user-scalable=0, minimal-ui" charset="UTF-8"/>
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"/>
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/site.css"/>
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
</head>
<body>
<div class="site-header">
    <div class="header-inner clearfix">
        <div class="search">
            <form th:action="@{search}"  method="post" th:method="post">
                <input type="text" name="searchValue" th:value="${searchValue}"/>
                <button type="submit">搜索</button>
            </form>
        </div>
    </div>
</div>
<div class="site-body">
    <div class="body-inner">
        <div class="body-left pt20">
            <div class="m-tab card">
                <ul class="tab-header">
                    <li class="cur">
                        <a href="/reviews">开箱</a>
                    </li>
                </ul>
                <div class="tab-body">
                    <ul class="m-review-list" th:if="${resultList} !=null">
                        <li class="review-item" th:each="resultList:${resultList}">
                            <div class="item-left" >
                                <dt class="highlight">
                                    <a target="_blank" th:href="${'allContents?url='+resultList.urlInfo}">
                                        <span th:utext="${resultList.bookname}"></span>
                                    </a>
                                </dt>
                                <dt th:if="${resultList.desc} !=null">
                                    <span  th:utext="${resultList.desc}"></span>&nbsp;&nbsp;&nbsp;
                                </dt>
                                <dt th:if="${resultList.author} !=null" >
                                    <span th:utext="${resultList.author}"></span>&nbsp;&nbsp;&nbsp;
                                </dt>
                                <dt th:if="${resultList.bookType} !=null">
                                    <span  th:utext="${resultList.bookType}"></span>&nbsp;&nbsp;&nbsp;
                                </dt>
                                <dt th:if="${resultList.updateTime} !=null" >
                                    <span th:utext="${resultList.updateTime}"></span>&nbsp;&nbsp;&nbsp;
                                </dt>
                                <dt th:if="${resultList.newChapter} !=null" >
                                    <div th:if="${resultList.newChapterUrl} !=null" >
                                        <a target="_blank" th:href="${'goMagnet?url='+resultList.newChapterUrl}"  >
                                            <span th:utext="${resultList.newChapter}"></span>
                                        </a>
                                    </div>
                                    <div th:if="${resultList.newChapterUrl} ==null" >
                                            <span th:utext="${resultList.newChapter}"></span>
                                    </div>
                                </dt>
                            </div>
                        </li>
                    </ul>
                    <div class="m-pagination">
                        <ul>
                            <li class="btn-prev btn-disabled" th:if="${currentCount} &gt; 1">
                                <a href="javascript:;" onclick="turnPage(-1)">上一页</a></li>
                            <li class="cur">
                                <a class="J_btnFlip"><span id="currentCount" th:utext="${currentCount}"></span></a></li>
                            <li class="btn-next" th:if="${currentCount} ne ${pageCount}">
                                <a class="J_btnFlip" onclick="turnPage(1)">下一页</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="site-footer">
    <div class="footer-inner">
        <ul class="site-links">
            <li><a href="">帮助中心</a></li>
            <li><a href="">服务条款</a></li>
            <li><a href="">联系我们</a></li>
            <li><a href="">关于我们</a></li>
        </ul>
        <div class="site-copyright">© 2011-2016 boxopened 苏ICP备16031736号</div>
    </div>
</div>
<script type="text/javascript">
    function turnPage(count){
        var searchValue = $("#searchValue").val();
        console.log(searchValue+"---- ");
        var currentCount = $("#currentCount").text();
        currentCount = parseInt(currentCount) + count;
        console.log(currentCount+" "+count);
        var url =  "/turnPage?currentCount="+currentCount+"&searchValue="+searchValue;
        window.location.href=url;
    }
</script>
</body>
</html>